﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using Provausio.Common.Objects;
using TrainingManagement.api.Models.BusinessObjects;
using Provausio.Common.Utility.Extensions;

namespace TrainingManagement.api.Models.Data.Readers
{
    public class SkillSetDataReader : BusinessOperation<IDataRecord, SkillSet>
    {
        public override SkillSet Run(IDataRecord input)
        {
            var skillset = new SkillSet();
            skillset.Title = input["Title"].ToString();
            skillset.SkillSetId = input["SkillSetID"].DbTo<int>();
            return skillset;
        }
    }
}